﻿using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;
using System.Text.RegularExpressions;

namespace WebApp
{
    public partial class text : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            //冒泡排序
            int[] array = new int[5] {20,8,2,9,1 };//声明一个数字长度为5
            int temp = 0;
            int j, i;
            for (i = 0; i < array.Length - 1; i++ )
            {
                for (j = i + 1; j < array.Length;j++ )
                {
                    if(array [i]>array [j])
                    {
                        temp = array[i];
                        array [i]=array [j];
                        array [j]=temp ;
                    }
                }
            }
            for (i = 0; i < 5;i++ )
            {
                Label1.Text += Convert.ToString(array [i])+",";
            }
            int[] arrays = new int[5] { 0020, 008, 002, 009, 001 };
            Random ro = new Random();
            string str = Convert.ToString(ro.Next(arrays[1]));
            str = str.TrimStart('0');
            //str = Regex.Replace(str, "[0]*([1-9][0-9]*)", "$1");
            Console.WriteLine(str);
            


        }
    }
}

